package com.btpj.blog_server.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class viewCountComponent {

    @Autowired
    ArticleService articleService;

    // 定时任务，每天执行一次
    @Scheduled(cron = "1 0 0 * * ?")
    public void viewCountPerDay() {
        articleService.viewCountPerDay();
    }
}
